<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


// 后台路由组
Route::prefix('admin')->name('admin.')->middleware('auth')->group(function  ()  {
    Route::get('/',  "Admin\IndexController@index");
    Route::resource("/news","Admin\NewsController");
    Route::group(['prefix'  =>  'config'],  function  ()  {
        // Route::resource('/site',  "Admin\ConfigController");
        Route::get('/site',  "Admin\ConfigController@siteconfig")->name("config.siteconfig");
        Route::post("/store","Admin\ConfigController@store")->name("config.store");
    });
    Route::resource("/cate","Admin\CateController");
    Route::resource("/case","Admin\CaseController");
    Route::post("/delh","Admin\CaseController@delh")->name("case.delh");
    Route::resource("/product","Admin\ProductController");
    Route::post("/destr","Admin\ProductController@destr")->name("product.destr");
    Route::resource("/friend","Admin\FriendController");
    Route::get("/page/createzx","Admin\PageController@createzx")->name('page.createzx');
    Route::get("/page/lists","Admin\PageController@lists")->name('page.lists');
    Route::get("/page/add","Admin\PageController@add")->name('page.add');
    Route::get("/page/editlc/{page}","Admin\PageController@editlc")->name('page.editlc');
    Route::resource("/page","Admin\PageController");
    Route::resource("/banner","Admin\BannerController");
    Route::post("/banneritem/setsort","Admin\BanneritemController@setsort")->name('banneritem.setsort');
    Route::resource("/banneritem","Admin\BanneritemController");

    Route::get("/logout","Admin\LoginController@logout")->name('login.logout');
});
Route::get("/admin/login","Admin\LoginController@index")->name('admin.login.index');
    Route::post("/admin/dologin","Admin\LoginController@dologin")->name('admin.login.dologin');
    Route::prefix('index')->name('index.')->group(function  ()  {
        Route::get("/","Home\IndexController@index")->name('home');
        Route::get("/product","Home\ProductController@index")->name('product.index');
        Route::get("/show/{product}","Home\ProductController@show")->name('product.show');
        Route::get("/case","Home\CaseController@index")->name('case.index');
        Route::get("/news","Home\NewsController@index")->name('news.index');
        Route::get("/news/show/{news}","Home\NewsController@show")->name('news.show');
        Route::get("/page","Home\PageController@index")->name('page.index');
    });
